package org.example.order.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Pattern;

import java.util.Date;

/**
 * 收货地址VO
 */
@Data
public class AddShippingAddressVO {
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @NotBlank(message = "收货人姓名不能为空")
    @Size(max = 64, message = "收货人姓名长度不能超过64个字符")
    private String receiverName;

    @NotBlank(message = "收货人电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @Size(max = 20, message = "收货人电话长度不能超过20个字符")
    private String receiverPhone;

    @NotBlank(message = "省份不能为空")
    @Size(max = 64, message = "省份长度不能超过64个字符")
    private String province;

    @NotBlank(message = "城市不能为空")
    @Size(max = 64, message = "城市长度不能超过64个字符")
    private String city;

    @NotBlank(message = "区/县不能为空")
    @Size(max = 64, message = "区/县长度不能超过64个字符")
    private String district;

    @NotBlank(message = "详细地址不能为空")
    @Size(max = 255, message = "详细地址长度不能超过255个字符")
    private String detailAddress;

    @NotNull(message = "是否默认地址不能为空")
    @Min(value = 0, message = "是否默认地址值不正确")
    @Max(value = 1, message = "是否默认地址值不正确")
    private Integer isDefault;
}